<template>
  <div>
      <h1>注册页面</h1>
      <p>请输入用户名: <input type="text" v-model="username"></p>
      <p>请输入账号: <input type="text" v-model="card"></p>
      <p>请输入密码: <input type="password" v-model="password"></p>
      <p>请输入所属年级:
          <select v-model="grade">
              <option value="1">小班</option>
              <option value="2">中班</option>
              <option value="3">大班</option>
          </select>
      </p>
      <p><input type="button" value="注册" @click="btn"></p>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            username:"",
            card:"",
            password:"",
            grade:""
        }
    },
    methods: {
        btn(){
            axios.post("http://127.0.0.1:8000/app1/user/",{"username":this.username,"password":this.password,"card":this.card,"grade":this.grade}).then(resp=>{
                console.log(resp.data)
            })
        }
    },
}
</script>

<style>

</style>